package com.kuang.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;


//在templates 目录下面的只能通过controlle来跳转
//这个需要模板引擎的支持   thymeleaf
@Controller//跳到页面
public class IndexController {

    @RequestMapping("/a")
    public String index(){
        return "index";
    }


    @RequestMapping("/t1")
//    @ResponseBody
    public String test(Model model){
        model.addAttribute("msg","<h1>hello springboot</h1>");
        model.addAttribute("users",Arrays.asList("zls","kuangshen"));
        return "test";
    }

}
